package com.karaoke.oksrv.controller

import com.github.pagehelper.PageInfo
import com.karaoke.oksrv.domain.DataDictionary
import com.karaoke.oksrv.domain.QSinger
import com.karaoke.oksrv.domain.Singer
import com.karaoke.oksrv.service.SingerService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.*

/**
 * Created by allen on 2017/4/18.
 */
@RestController
@RequestMapping("/api/v1/singer")
class SingerController
{
    @RequestMapping(value = "/singers", method = arrayOf(RequestMethod.POST))
    fun getSingers(@RequestBody params: QSinger): PageInfo<Singer> = singerService.getSingers(params)

    @RequestMapping(value = "/{id}")
    fun getSinger(@PathVariable id: Int) = singerService.getSingerById(id)
    @Autowired lateinit var singerService: SingerService
}